﻿using System.Collections.Generic;
namespace DarrenSoft.Facade
{
    using DarrenSoft.Domain.DomainBase;
    using DarrenSoft.Domain.Extends;
    public interface IBaseFacade<T> where T:Entity
    {
        /// <summary>
        /// 通过主键返回对象
        /// </summary>
        /// <param name="id">主键值</param>
        /// <returns></returns>
        T Get(object id);
       
        /// <summary>
        /// 保存对象
        /// </summary>
        /// <param name="model">实体</param>
        /// <returns></returns>
        object Insert(T entity);

        /// <summary>
        /// 更新对象
        /// </summary>
        /// <param name="model">实体</param>
        bool Update(T entity, string primaryKeyValue);

       

        /// <summary>
        /// 删除对象
        /// </summary>
        /// <param name="model">实体</param>
        void Delete(object id);

       
        /// <summary>
        /// 获取所有记录
        /// </summary>
        /// <returns></returns>
        IList<T> GetAll();
        List<T> Find(out int recordsCount,string condition, PagerBase info);
    }
}
